/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VendaProduto.java
 *
 * Created on 05/12/2010, 14:47:53
 */

package sysype;

import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

/**
 *
 * @author SERVIDOR
 */
public class VendaProduto extends javax.swing.JInternalFrame {

    /** Creates new form VendaProduto */
    public VendaProduto() {
        initComponents();
        

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jtProduto = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jtPesquisa = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jlValorTotal = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();

        setBackground(new java.awt.Color(255, 255, 255));
        setClosable(true);
        setIconifiable(true);
        setTitle("Venda de Produtos");
        getContentPane().setLayout(null);

        jtProduto.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Referencia", "Nome do Produto", "Estoque"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jtProduto.setColumnSelectionAllowed(true);
        jtProduto.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(jtProduto);
        jtProduto.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jtProduto.getColumnModel().getColumn(0).setResizable(false);
        jtProduto.getColumnModel().getColumn(1).setResizable(false);
        jtProduto.getColumnModel().getColumn(2).setResizable(false);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(10, 80, 350, 190);

        jLabel1.setFont(new java.awt.Font("Arial", 0, 12));
        jLabel1.setText("Nome do produto");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(10, 30, 110, 23);
        getContentPane().add(jtPesquisa);
        jtPesquisa.setBounds(130, 30, 240, 25);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Referencia", "Nome do Produto", "Preço Unitario", "Quantidade", "Preço total"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(jTable1);
        jTable1.getColumnModel().getColumn(0).setResizable(false);
        jTable1.getColumnModel().getColumn(1).setResizable(false);
        jTable1.getColumnModel().getColumn(2).setResizable(false);
        jTable1.getColumnModel().getColumn(3).setResizable(false);
        jTable1.getColumnModel().getColumn(4).setResizable(false);

        getContentPane().add(jScrollPane2);
        jScrollPane2.setBounds(400, 80, 370, 190);

        jlValorTotal.setFont(new java.awt.Font("Arial", 0, 36));
        jlValorTotal.setForeground(new java.awt.Color(255, 51, 51));
        jlValorTotal.setText("0,00");
        getContentPane().add(jlValorTotal);
        jlValorTotal.setBounds(610, 340, 80, 50);

        jLabel3.setFont(new java.awt.Font("Arial", 1, 36));
        jLabel3.setForeground(new java.awt.Color(255, 0, 0));
        jLabel3.setText("Valor total da compra:");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(190, 350, 410, 30);

        jLabel2.setFont(new java.awt.Font("Arial", 0, 36));
        jLabel2.setForeground(new java.awt.Color(0, 204, 0));
        jLabel2.setText("Dinheiro:");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(190, 400, 310, 40);

        jLabel4.setFont(new java.awt.Font("Arial", 0, 36));
        jLabel4.setForeground(new java.awt.Color(255, 255, 0));
        jLabel4.setText("Troco:");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(190, 450, 160, 43);

        jTextField1.setFont(new java.awt.Font("Arial", 0, 36));
        jTextField1.setForeground(new java.awt.Color(0, 204, 51));
        jTextField1.setText("0,00");
        getContentPane().add(jTextField1);
        jTextField1.setBounds(610, 400, 100, 50);

        jLabel5.setFont(new java.awt.Font("Arial", 0, 36));
        jLabel5.setForeground(new java.awt.Color(255, 255, 0));
        jLabel5.setText("0,00");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(610, 460, 116, 40);

        jLabel6.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel6.setText("Itens Na venda");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(480, 20, 200, 30);

        jButton1.setFont(new java.awt.Font("Arial", 0, 14));
        jButton1.setText("Adcionar Item");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1);
        jButton1.setBounds(240, 300, 120, 40);

        jButton2.setText("Excluir Item");
        getContentPane().add(jButton2);
        jButton2.setBounds(400, 300, 120, 40);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JLabel jlValorTotal;
    private javax.swing.JTextField jtPesquisa;
    private javax.swing.JTable jtProduto;
    // End of variables declaration//GEN-END:variables

}
